#include "visual.h"
#include <pcl-1.8/pcl/io/pcd_io.h>
#include <pcl-1.8/pcl/point_types.h>
#include <pcl-1.8/pcl/visualization/cloud_viewer.h>

int user_data;

//只调用一次 点云图的初始化
void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
    viewer.setBackgroundColor(0,0,0);
    //设置原点
    //pcl::PointXYZ o;
    //o.x = 0;
    //o.y = 0;
    //o.z = 0;
    //viewer.addSphere(o,0.25,"sphere",0); 
}

//多次调用
void viewerPsycho(pcl::visualization::PCLVisualizer& viewer)
{
    static unsigned count = 0;
    std::stringstream ss;
    ss<<"Once per viewer loop:"<<count++;
    viewer.removeShape("text",0);
    viewer.addText(ss.str(),200,300,"text",0);
    user_data++;
}